# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mtools
pkgver=4.0.45
pkgrel=0
pkgdesc="collection of utilities to access MS-DOS disks from Unix without mounting them"
url="https://www.gnu.org/software/mtools/"
arch="all"
license="GPL-3.0-or-later"
makedepends="texinfo linux-headers"
source="https://ftp.gnu.org/gnu/mtools/mtools-$pkgver.tar.bz2
	fix-uninitialized.patch
	"
subpackages="$pkgname-dbg $pkgname-doc"

build() {
	# todo: configure scripts are broken
	export CFLAGS="$CFLAGS -DOS_linux"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--sysconfdir=/etc/mtools \
		--without-x
	make
}

check() {
	make check
}

package() {
	make -j1 install DESTDIR="$pkgdir"
}

sha512sums="
2c0c557af6d3a2291862a15dd25628b8312dd2bb1f866c70db96b0241018550a884eb2b098a0e9b2c86c35246bc9b19deeb276e026cb223072605e97f0ab8579  mtools-4.0.45.tar.bz2
3c41e2f84d7c2b15b119708453b30b6a056a443dbbf24198f2bdc82c99e6463974f7bb0bb13569fd1f929212506d43deed1ed77502c434a89b2da885baeab597  fix-uninitialized.patch
"
